package model.skill;

import model.entity.Entity;
import utilities.*;

public abstract class ActivateableSkill extends Skill implements Archiveable {
	
	private int cost;
	
	public ActivateableSkill()
	{
	}
	
	public ActivateableSkill(String name, String skillType, int cost)
	{
		super(name, skillType);
		this.cost = cost;
	}
	
	public int getCost()
	{
		return cost;
	}
	
	public abstract void activate(Entity entity);
	
	public Archive save() {
		Archive archive = super.save();
		
		archive.putAttribute("cost", Integer.toString(this.cost));
		
		return archive;
	}
	
	public void load(Archive archive) {
		super.load(archive);
		this.cost = Integer.parseInt(archive.getAttribute("cost"));
	}
	
}
